//
//  UIButton+Extension.swift
//  Weibo
//
//  Created by apple on 15/7/3.
//  Copyright © 2015年 apple. All rights reserved.
//

import UIKit

extension UIButton {

    convenience init(title:String, imageName:String, fontSize: CGFloat, titleColor: UIColor = UIColor.darkGrayColor()){
    self.init()
    
    setTitle(" " + title, forState: UIControlState.Normal)
    setImage(UIImage(named: imageName), forState: UIControlState.Normal)
    titleLabel?.font = UIFont.systemFontOfSize(fontSize)
    setTitleColor(UIColor.darkGrayColor(), forState: UIControlState.Normal)
    
    
    }
    convenience init(title: String, fontSize: CGFloat, titleColor: UIColor = UIColor.whiteColor(), bgColor: UIColor = UIColor.brownColor()) {
        
        self.init()
        
        setTitle(title, forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
        setTitleColor(titleColor, forState: UIControlState.Normal)
        backgroundColor = bgColor

    }
}
